<template>
	<pageViewContainer :showHeader="false">
		<div class="home-center-container">
			<div class="welcome-animation-container">
				<el-icon :size="72" color="#f59e0b" class="welcome-icon">
					<Sunny />
				</el-icon>
				<div class="welcome-text">
					<h1>{{ welcomeTitle }}</h1>
					<p>{{ welcomeSubtitle }}</p>
				</div>
				<el-divider class="custom-divider" />
				<SystemInfo />
			</div>
		</div>
	</pageViewContainer>
</template>

<script setup>
import {
	ref,
	computed
} from 'vue'
import {
	useAccountStore
} from '../../stores/account'
import {
	Sunny
} from '@element-plus/icons-vue'
import SystemInfo from './components/SystemInfo.vue'

const accountStore = useAccountStore()

const welcomeTitle = computed(() => {
	return `你好, ${accountStore.username || '管理员'}!`
})

const welcomeSubtitle = ref('欢迎回到后台管理系统，祝您工作顺利')
</script>

<style scoped lang="less">
.home-center-container {
	background-image: url('/src/assets/bg.svg');
	background-size: 100% 100%;
	background-color: #ffffff;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	text-align: center;
}

.welcome-animation-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 30px;


	max-width: 700px;
	width: 100%;
}

@keyframes fadeInSlideUp {
	from {
		opacity: 0;
		transform: translateY(70px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.welcome-icon {
	margin-bottom: 20px;
	animation: fadeInSlideUp 0.8s ease-out forwards;
	opacity: 0;
}

.welcome-text h1 {
	font-size: 26px;
	font-weight: 600;
	color: #303133;
	margin-bottom: 6px;
}

.welcome-text p {
	font-size: 15px;
	color: #606266;
	line-height: 1.5;
}

.custom-divider {
	margin: 20px 0;
	width: 50%;
	border-top: 1px solid #e4e7ed;
}
</style>